import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../view/layout/layout'
Vue.use(Router)
export default new Router({
  // mode: 'history',
  routes: [
    // {
    //   path: '/',
    //   name: 'index',
    //   component: () => import('@/view/Index/index')
    // },
    {
      path: '/',
      component: Layout,
      meta: { title: '首页', icon: 'index' },
      children: [{
        path: 'index',
        name: 'index',
        meta: { title: '首页', icon: 'index' },
        component: () => import('@/view/Index/index')
      }]
    },
    {
      path: '/admin',
      component: Layout,
      meta: { title: '测试', icon: 'index' },
      children: [
        {
          path: 'index2',
          name: 'adminHello2',
          meta: { title: '测试', icon: 'index' },
          component: () => import('@/components/HelloWorld')
        },
        {
          path: 'table',
          name: 'table',
          meta: { title: '表格测试', icon: 'index' },
          component: () => import('@/view/tableList/tabBody')
        }
      ]
    }
  ]
})
export const asyncRouterMap = [
  {
    _path: '/',
    get path () {
      return this._path
    },
    set path (value) {
      this._path = value
    },
    children: [{
      path: 'ceshi',
      component: () => import('@/view/Index/index'),
      name: 'ceshi',
      meta: { title: 'ceshi', icon: 'ceshi', noCache: true }
    }]
  },
  {
    path: '/word',
    children: [{
      path: 'ceshi',
      component: () => import('@/view/Index/index'),
      name: 'ceshi',
      meta: { title: 'hahah', icon: 'ceshi', noCache: true }
    }]
  }
]
